package com.lsmo.android.carfans;

import android.app.Application;
import android.content.pm.PackageManager;

import com.lsmo.android.util.Caller;
import com.lsmo.android.util.ImageCache;
import com.lsmo.android.util.RequestCache;

/***
 * 
*
* @类描述： 全局变量                                                    
* @项目名称：carfans     
* @类名称：Global                    
* @修改时间：2012-3-21 下午08:26:25    
* @修改备注：                                                              
*
 */
public class Global extends Application {

	public static final boolean Debug = true ;
	
	public static final String SoftName = "carFans";
	public static String TAG = "carFans";
	private static Global instance;
	private ImageCache mImageCache;
	private RequestCache mRequestCache;
	public static int current_tab = 0;//当前的tab
	
	public static Global getInstance()
	{
		 return instance;
	}

	public ImageCache getImageCache()
	{
	    return mImageCache;
	}
	  
	//获取系统版本
	public String getVersion(){
		PackageManager localPackageManager = getPackageManager();
		String str2 = "";
		try {
			String str1 = getPackageName();
		    str2 = localPackageManager.getPackageInfo(str1, 0).versionName;
		   
		} catch (PackageManager.NameNotFoundException localNameNotFoundException) {
			localNameNotFoundException.printStackTrace();
		}
		 return str2;
	}

	@Override
	public void onCreate() {
		super.onCreate();
		mImageCache = new ImageCache();
		mRequestCache = new RequestCache();
		
		Caller.setRequestCache(mRequestCache);
		instance = this;
	}

	public static int getCurrent_tab() {
		return current_tab;
	}

	public static void setCurrent_tab(int currentTab) {
		current_tab = currentTab;
	}
	
}
